-
Notifications
You must be signed in to change notification settings - Fork 36
Separate compilation of module-info.java #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate compilation of module-info.java #73
Conversation
9b94f1d
to
365192c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally had time to review this. Really excellent work!
I have a few very minor suggestions and questions, but other than that I'm happy to merge.
src/main/java/org/javamodularity/moduleplugin/extensions/ModularityExtensionImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/org/javamodularity/moduleplugin/extensions/ModularityExtensionImpl.java
Outdated
Show resolved
Hide resolved
README.md
Outdated
Compilation to a specific Java release | ||
---- | ||
|
||
For Java releases 6-8, see [Separate compilation of `module-info.java`](#separate-compilation-of-module-infojava). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some more description why this is useful and when to use which option. You explained this really well in the issue, maybe move some of that to the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added more description, although I didn't copy it from the issue, because it seemed to me I already copied all the necessary stuff to the "Separate compilation of module-info.java
" section.
Please, let me know if the updated version reads well. I'll gladly reword/restructure it further if you provide me with any remarks you might have.
Thanks for your feedback, Paul! I'll provide the requested changes within a few days. Please, let me know if you prefer:
As I mentioned, I'd much prefer that the commits aren't squashed for clear change history. |
I'm fine with either, whatever you think shows intentions best. |
necessary for further commits MAIN: 1) renamed TestModuleOptions.isRunOnClasspath() to getRunOnClasspath() (otherwise won't work with Kotlin DSL) + added a Kotlin DSL example for "runOnClasspath = true" to README.md 2) introduced JavaProjectHelper and applied it to CompileTask 3) added comments for all anonymous classes that should not be removed 4) minor improvements in ModuleSystemPlugin 5) minor fixes in test-project-kotlin/README.md TEST: 1) bumped smoke-test Gradle version to 5.0 (for improved Kotlin DSL) 2) introduced a no-op "moduleOptions" access in greeter.api (for testing DSL) 3) introduced SmokeTestHelper for ModulePluginSmokeTest 4) disabled stackTraceFilters in all tests 5) updated Kotlin to 1.3.20
…rately" added CompileModuleOptions and CompileModuleInfoTask NOTE: potentially breaking change for "compileJava" in Kotlin DSL (see modified "build.gradle.kts")
via ModularityExtension interface
tests the "modularity" extension (incl. verifying generated class file formats)
3df9122
to
86e65c4
Compare
A proof of concept for #72 (actually, it's a fully working solution, but since #72 hasn't been discussed yet, I call it a proof of concept for now).
This PR consists of four clearly separated commits (every commit passes the build):
TestModuleOptions.isRunOnClasspath()
togetRunOnClasspath()
(otherwise it doesn't work with Kotlin DSL)moduleOptions.compileModuleInfoSeparately
(low-level API)moduleOptions.compileModuleInfoSeparately = true
, introduces a specialcompileModuleInfoJava
task → boils down to (Groovy DSL):compileModuleInfoJava
instead ofcompileJava
(but always usingcompileJava
's class-path as module-path)module-info.class
location: root output directoryCompileModuleOptions extends ModuleOptions
, which is a potentially breaking change forcompileJava
in Kotlin DSL (see modifiedbuild.gradle.kts
)modularity
project extension (high-level API)ModularityExtension
interface--release
options forcompileJava
andcompileModuleInfoJava
test-project-mixed
modularity.mixedJavaRelease
andmodularity.standardJavaRelease
local_maven_build.gradle
andsmoke_test_build.gradle
by usingpluginManagement
in*_settings.gradle
files (can be ported to other test projects)PS. If you decide to merge this PR, I'd appreciate if you didn't squash the commits (they are separated on purpose, to provide a clear change history).